<%@page import="com.weixinli.beans.UserInfo"%>
<%@page import="com.weixinli.utils.SessionAttributeName"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!doctype html>
<html><!-- InstanceBegin template="/Templates/index.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta charset="utf-8">
<!-- InstanceBeginEditable name="title" -->
<title>微笑墙</title>
<link rel="stylesheet" type="text/css" href="../css/index.css">
<link rel="shortcut icon" type="text/css" href="../images/favicon.ico"/>
<link rel="stylesheet" type="text/css" href="css/smile_photo.css">
<script src="js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="js/ajaxfileupload.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.10.4.custom.min.js"></script>
<script src="js/smile_photo.js"></script>
<script type="text/javascript">
	function upl(){
		var date = new Date();
		var h = date.getHours();   //小时
		var m = date.getMinutes().toString();   //分
		var time=date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate()+" "+h+":"+m;
		$("#up_time").val(time);
		$("#myform").submit();
	}
</script>

<!-- InstanceEndEditable -->
</head>

<body>
<!--头部开始-->
<div class="header">
    <div class="logo">
        <a href="../index.html"><img src="../images/logo.png"></a>
    </div>
    <div class="nav">
        <ul>
            <li><a href="../index.jsp" class="tit">首页</a></li>
            <li><a href="javaScript:getInfo()" class="tit">心理FM</a></li>
            <li><a href="../moods/moods.jsp" class="tit">心情说</a></li>
            <li><a href="../article/article.jsp" class="tit">杂志</a></li>
            <li><a href="../test/test.jsp" class="tit">测试</a></li>
            <li><a href="smile.jsp" class="tit">微笑墙</a></li>
        </ul>
    </div>
    <div class="reg">
        <ul>
           <c:if test="${empty sessionScope.currentUser}">
	            <li><a href="../login/login.html" id="login_logo">登录</a></li>
	            <li><span class="line"></span></li>
	            <li><a href="../reg/reg.html" id="reg_logo">注册</a></li>
	       	</c:if>
	       	<c:if test="${!empty sessionScope.currentUser}">
	       		<li id="myli"><span>欢迎您</span>[<a href="userServlet?op=getPerInfo" style="color:yellow;font-size:12px;" id="user_email">${sessionScope.currentUser.w_email}</a>]
	       		<span id="myspan"></span>
	       		<div id="current_userInfo">
	       			<dl>
	       				<dd><a href="#">个人中心</a></dd>
	       				<dd><a href="#">发表说说</a></dd>
	       				<dd><a href="#">我的通知</a></dd>
	       				<dd><a href="exit.jsp">退&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;出</a></dd>
	       			</dl>
	       		</div>
	       		</li>
	       	</c:if>
        </ul>
    </div>
    <div class="sear">
        <form target="_blank" action="" method="get">
            <input type="text" class="text" name="sear" placeholder="搜索" />
            <input type="submit" class="submit" value="&#10140;"/>
        </form>
    </div>
</div>
<!--头部结束-->
<!-- InstanceBeginEditable name="content" -->
<div class="smile_photo">
	<div class="smile_photo_way">
    	<h4>选择上传方式</h4>
        <ul>
        	 
            <li class="smile_photo_way_local">
                <span id="smile_text_tu"></span>
                <span id="smile_text">点击上传</span>
                <form id="myform" action="../supload/SmileAction_addSmile_smile_smile" method="post" enctype="multipart/form-data">
                <input id="smile_file" name="file" type="file" accept="images/*" onChange="setImagePreviews(this)"/>
 			</li>
    		
            <li class="smile_photo_way_pic" onClick="s_photoupload()"><span class="smile_photo_way_tu2" ></span>拍照上传</li>
        </ul>
        <p>仅支持JPG、GIF、PNG格式，文件小于5M。</p>
    </div>
    
    <div class="smile_photo_show" >
    	<div class="smile_photo_upload" style="display:block">
    		<div class="smile_photo_bg"><img  src="images/s_upload.png" /></div>
   		</div>
        <div class="smile_photo_pic" style="display:none">
        	<p>您上传的图片将生成如下图像，请注意图片是否清晰！</p>
        	<div class="simle_photo_can" id="simle_photo_can">
            	
            </div>
           	<br />
           	<div id="smile_input">
           		<input id="currentUser" name="smile.w_uid" type="hidden" value="${sessionScope.currentUser.w_uid}">
           		<input id="up_time" name="smile.stime" type="hidden">
           		<label>微笑名称 :</label> <input type="text" name="smile.sname" id="sinput_sname" class="sinput_sname"/><br /><br />
         	 	<label>微笑描述 :</label> <input type="text" name="smile.sdec" id="smile_sdec" class="smile_sdec"/><br /><br />
           	</div>
           <input type="button" onclick="upl()" value="确定" id="s_photo_button" />
        </form>
    	</div>
        
        <div class="simle_photo_video">
        	<video width="300px" height="300px" id="s_video" autoplay></video>
            <input type="button" value="拍照" id="s_pic_button" onClick="s_takephoto()"/>
            
        </div>
        
        <div class="smile_photo_pic1" >
        	<p>您上传的图片将生成如下图像，请注意图片是否清晰！</p>
        	<form action="" method="post" enctype="multipart/form-data">
            <canvas width="300px" height="200px" id="s_photo_canvas" ></canvas>
            
            
    	</div>
    	
    	<div id="s_box" class="s_box" style="display:none">
        	<div id="s_main" class="s_main" style="width:150px;height:150px;">
            	<div id="left-up" class="minDiv left-up"></div>
                <div id="s_left" class="minDiv left"></div>
                <div id="left-down" class="minDiv left-down"></div>
                <div id="s_up" class="minDiv top"></div>
                <div id="right-up" class="minDiv right-up"></div>
                <div id="s_right" class="minDiv right"></div>
                <div id="right-down" class="minDiv right-down"></div>
                <div id="s_down" class="minDiv bottom"></div>
            </div>
        </div>
        
 		<div id="spreview" style="display:none">
            <canvas id="scanvas" width="200px" height="200px"></canvas>
            <img id="sphoto" />
            <div id="sc_input">
            		<input id="up_time" type="hidden">
            		<label>微笑名称 :</label> <input type="text"  id="sp_sname"/><br /><br />
          	 		<label>微笑描述 :</label> <input type="text" id="sp_sdec" ></textarea><br /><br />
        
         		   <input type="button" value="确定" onClick="photoUpload()" id="s_photo_button" />
            </div>
		</div>
    </div>
  </form>   
</div>

	
<!-- InstanceEndEditable -->
<!--内容部分结束-->
<div id="footer">
  <div id="footer_content">
       	<div id="nav">
            <ul>
                <li><a href="#">关于我们</a></li>
                <li><a href="#">加入我们</a></li>
                <li><a href="#">联系我们</a></li>
                <li><a href="#">免责声明</a></li>
                <li><a href="#">友情链接</a></li>
                <li><a href="#">网站地图</a></li>
                <li><a href="#">手机版</a></li>
                <li><a href="#">手机应用</a></li>
                
            </ul>
        </div>
        <div id="links">
            <span>友情链接：</span>
            <ul>
                <li><a target="_blank" href="http://www.nlp.cn/">NLP心理学</a></li>
                <li><a target="_blank" href="http://zhidao.baidu.com/daily/">百度知道日报</a></li>
                <li><a target="_blank" href="http://iask.fh21.com.cn/">飞华问医生</a></li>
                <li><a target="_blank" href="http://www.dxsbb.com/">大学生网</a></li>
                <li><a target="_blank" href="http://yuwen.chazidian.com/">语文网</a></li>
                <li><a target="_blank" href="http://tag.120ask.com/"> 有问必答知识库</a></li>
                <li><a target="_blank" href="http://www.xinli001.com/zx/">心理咨询</a></li>
                <li><a target="_blank" href="http://wannianli.tianqi.com/">天气网</a></li>
                <li><a target="_blank" href="http://www.pm25.com/">绿色呼吸</a></li>
                <li><a target="_blank" href="http://www.vmovier.com/">V电影</a></li>
                <li><a target="_blank" href="http://iask.sina.com.cn/c/79.html ">爱问健康</a></li>
            </ul>
        </div>
        <div id="copyright">
            <div id="footer_1">
                &copy; 2015 All Rights Reserved. <a target="_blank" href="http://www.miibeian.gov.cn/">粤ICP备12051153号</a>
            </div>
            <div id="footer_2">
                <a href="#">
                    <img src="../images/footer_pic1.png" align="absmiddle" />
                </a>
                <a href="#">
                    <img src="../images/footer_pic2.png" align="absmiddle" />
                </a>
            </div>
        </div>
    </div>
</div>
</body>
<!-- InstanceEnd --></html>
